package org.jow.worldsrv;

import java.io.IOException;

import org.jow.core.InputStream;
import org.jow.core.OutputStream;
import org.jow.core.Record;
import org.jow.core.interfaces.ISerilizable;
import org.jow.worldsrv.character.${character?lower_case}.${character}Object;
<#list methodsList as m>
<#list m.importPackages as package>
import ${package};
</#list>
</#list>

/**
 * @author gaopan
 *
 * ${character}Object模块的基类
 */
public abstract class Module${character}Base implements ISerilizable {
	
	/** 角色 */
	protected ${character}Object ${character?uncap_first}Obj;
	
	public Module${character}Base() {}
	
	/**
	 * 初始化
	 * 
	 * @param isLogin
	 */
	public void initData(boolean isLogin) {}
	
	/**
	 * 心跳
	 * @param now
	 */
	public void pulse(long now) {}
	
	/**
	 * 处理外来record（通常来自跨服）
	 * @param record
	 */
	public void processRecord(Record record) {}
	
	@Override
	public void writeTo(OutputStream out) throws IOException {}

	@Override
	public void readFrom(InputStream in) throws IOException {}

	public ${character}Object get${character}Obj() {
		return ${character?uncap_first}Obj;
	}

	public void set${character}Obj(${character}Object ${character?uncap_first}Obj) {
		this.${character?uncap_first}Obj = ${character?uncap_first}Obj;
	}
	
	<#list methodsList as m>
	public ${m.className} get${m.className}() {
		return ${character?uncap_first}Obj.get${character}Module().get${m.className}();
	}
	
	</#list>
	
}
